package cn.schoolwow.flow.monitor.entity;

import cn.schoolwow.quickdao.annotation.*;

import java.time.LocalDateTime;

@Comment("定时任务")
@UniqueField(columns = {"categoryName", "name"})
@CompositeIndex(columns = {"categoryName", "name"},indexType = IndexType.UNIQUE)
public class ScheduleJob {
    @Id
    private long id;

    @Comment("定时任务分类")
    @Constraint(notNull = true)
    private String categoryName;

    @Comment("定时任务名称")
    @Constraint(notNull = true)
    private String name;

    @Comment("CRON表达式")
    @Constraint(notNull = true)
    private String cron;

    @Comment("是否启用")
    @Constraint(notNull = true,defaultValue = "1")
    private boolean enable;

    @TableField(createdAt = true)
    private LocalDateTime createdAt;

    @TableField(updatedAt = true)
    private LocalDateTime updatedAt;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCron() {
        return cron;
    }

    public void setCron(String cron) {
        this.cron = cron;
    }

    public boolean isEnable() {
        return enable;
    }

    public void setEnable(boolean enable) {
        this.enable = enable;
    }

    public LocalDateTime getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }

    public LocalDateTime getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(LocalDateTime updatedAt) {
        this.updatedAt = updatedAt;
    }
}
